<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>视频融合</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>
    <div id="mapContainer" style="position: relative;"></div>
</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [120.19666243106221, 30.28722939385621, 4000], //相机的位置
        lookAt: [120.19666243106221, 30.28722939385621, 0], //相机看向的地图位置
        cameraScrollSpeed: 5, //鼠标滚动时，控制相机移动的速度
        minZoom: 3, //允许地图的最小层级
        maxZoom: 18, //允许地图的最大层级
        ambientLightIntensity: 5,
        useDefaultTexture: true, //是否使用瓦片默认纹理
        baseLayer: [
            //影像底图
            {
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', //影像底图的url
                // url: 'http://115.236.87.26:8848/googleTiles/china_image/{z}/{y}/{x}.jpg',
                urlDecimal: true, //影像底图url中的瓦片行列号是否是十进制，true表示十进制，false表示十六进制
                tileType: 'image', //影像底图
                canNotSelect: false, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            }
        ]
    });
    // addHlsObject(120.170646, 30.28362, 500);
    addVideoObject(120.189646, 30.28362, 500);

    // addHlsObject(120.170646 + 0.05, 30.28362, 500);
    // addVideoObject(120.189646 + 0.05, 30.28362, 500);

    // app.openStats();

    //http live streaming视频源
    function addHlsObject(longitude, latitude, height) {
        let videoObject = new GE.VideoObject({
            position: new GE.Point(longitude, latitude, height),
            // url: 'https://124.160.59.197:6014/openUrl/caGryik/live.m3u8',
            // url: 'https://demo.m3u8play.com/m3u8/out/demo.m3u8',
            url: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8',
            // url: 'http://localhost:9000/examples/resources/video/bbb.flv',
            width: 1920,
            height: 1080
        })
        app.add(videoObject);

        window.hlsObject = videoObject;
    }

    //mp4视频源
    function addVideoObject(longitude, latitude, height) {
        let videoObject = new GE.VideoObject({
            position: new GE.Point(longitude, latitude, height),
            // url: 'http://192.168.2.100:8702/resources/1b8b2fcb26b020120aebfac57779e06a/video/test.mp4',
            // url: 'http://192.168.2.41:9000/examples/resources/video/3e5e8e19b83ffe292b9b35e47b44ec1b.mp4',
            // url: 'https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4',
            url: 'http://localhost:9000/examples/resources/video/bbb.flv',
            width: 1920,
            height: 1080
        })
        app.add(videoObject);

        window.videoObject = videoObject;

        // window.app.on('Click', function (e) {
        //     videoObject.playVideo();
        //     console.log(e);
        // });
    }

   

</script>

</html>